﻿using Business;
using Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BookManageSys
{
    public partial class UserLogin : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            UsersEntity ue = new UsersEntity();
            ue.Username = username.Text;

            UsersBusiness ub = new UsersBusiness();
            if (password.Text == ub.GetPasswordByUserName(ue).ToString())
            {
                Session["UserName"] = username.Text;
                Response.Write("<script>alert('登录成功！'),location.href='/User/UserMain.aspx'</script>");
            }
            else
            {
                Response.Write("<script>alert('账号或密码错误！')</script>");
            }
        }
    }
}